package uk.co.tarbard.svnreporter.logentries;

import java.util.Date;
import java.util.Map;

public class LogEntry {

	private String author;
	private Map changedPaths;
	private Date date;
	private String message;

	long revision;

	public LogEntry(Map changedPaths, long revision, String author, Date date, String message) {
		this.author = author;
		this.changedPaths = changedPaths;
		this.date = date;
		this.message = message;
		this.revision = revision;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Map getChangedPaths() {
		return changedPaths;
	}

	public void setChangedPaths(Map changedPaths) {
		this.changedPaths = changedPaths;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public long getRevision() {
		return revision;
	}

	public void setRevision(long revision) {
		this.revision = revision;
	}

	@Override
	public String toString() {
		return revision + ":" + author + ":" + message + ":" + date;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final LogEntry other = (LogEntry) obj;
		if (author == null) {
			if (other.author != null)
				return false;
		} else if (!author.equals(other.author))
			return false;
		if (changedPaths == null) {
			if (other.changedPaths != null)
				return false;
		} else if (!changedPaths.equals(other.changedPaths))
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (message == null) {
			if (other.message != null)
				return false;
		} else if (!message.equals(other.message))
			return false;
		if (revision != other.revision)
			return false;
		return true;
	}

	
}
